define([
    '../libs/zepto',
    '../common/base',
    '../common/dialog',
    '../common/common_click',
    '../common/ajax'],function(){
    this.init = function(){
        setCss();
    }

    function setCss(){
        var whole_height = window.innerHeight;
        var head_height = $('.header').height();
        var foot_height = $('.footer').height();
        $('.find-content').css('height',whole_height-head_height-foot_height);
        
        var list = '<li><div class="findList1">'+
                    '<img class="guid" src="/images/zhinan.png" alt=""><span>考试指南</span>'+
                    '<img src="/images/getInto.png" alt=""></div></li>'+
            		'<li><div class="findList2" id="jpkcBtn"><img class="zixun" src="/images/zixun.png" alt=""><span>资讯站-<b class="aa">获取各种考试信息</b></span>'+
                    '<img src="/images/getInto.png" alt=""></div></li>'+
                    '<li><div class="findList2" id="jpkcBtn"><img class="chanpin" src="/images/chanpin.png" alt=""><span>产品站-<b class="aa">了解更多版本的考试产品</b></span>'+
                    '<img src="/images/getInto.png" alt=""></div></li>';
        $('.find-ullist').append(list);
        var html='<ul class="wechatBox">'+
            '<li class="wechatBig">关注微信公众号获取更多资讯</li>'+
            '<li class="wechatBig" style="font-size: 1.5rem;">到微信添加<span id="wechatName" data-clipboard-text="123">ytksbao8</span></li>'+
            '<li><img src="/images/qrcode.png" alt=""></li>'+
            '<li class="wechatSmall" style="font-size: 1.5rem;">点击二维码保存到相册</li>'+
            '<li class="wechatSmall" style="font-size: 1.5rem;">到微信中识别即可关注</li></ul>';
         $('.wechat').append(html);
        $('.find-ullist li').eq(0).on('click',function(){
            window.location.href = '/find/examGuide';
        });
        //资讯站=========================================================
        $('.find-ullist li').eq(1).on('click',function(){
            //浏览器类型
            function _getClientType() {
                if(navigator.userAgent.indexOf("MicroMessenger") !== -1) {
                    return 'web_messenger';
                } else if(navigator.userAgent.indexOf("Windows Phone") !== -1) {
                    return 'web_winphone';
                } else if(navigator.userAgent.indexOf("iPhone") !== -1) {
                    return 'web_iphone';
                } else if(navigator.userAgent.indexOf("Android") !== -1) {
                    return 'web_android';
                } else {
                    return 'web_pc';
                }
            }
            //安卓==========================================================
            if(_getClientType() == "web_android"){
                window.android.information('a');
            } else if(_getClientType() == "web_iphone" || "ipad" || "iphone") {
            	//iOS======================================================
                
               parent.window.location.href = 'ioszx://asd';
            }
        });
        
        $('.find-ullist li').eq(2).click(function(){
        	//浏览器类型
            function _getClientType() {
                if(navigator.userAgent.indexOf("MicroMessenger") !== -1) {
                    return 'web_messenger';
                } else if(navigator.userAgent.indexOf("Windows Phone") !== -1) {
                    return 'web_winphone';
                } else if(navigator.userAgent.indexOf("iPhone") !== -1) {
                    return 'web_iphone';
                } else if(navigator.userAgent.indexOf("Android") !== -1) {
                    return 'web_android';
                } else {
                    return 'web_pc';
                }
            }
            //安卓==========================================================
            if(_getClientType() == "web_android") {
                window.android.product('b');
            } else if(_getClientType() == "web_iphone" || "ipad" || "iphone") {
            //iOS======================================================产品站
               parent.window.location.href = 'ioscp2://asd';
            }
        });

        $('.wechatBox li img').on('click',function(){
            //浏览器类型
            function _getClientType() {
                if(navigator.userAgent.indexOf("MicroMessenger") !== -1) {
                    return 'web_messenger';
                } else if(navigator.userAgent.indexOf("Windows Phone") !== -1) {
                    return 'web_winphone';
                } else if(navigator.userAgent.indexOf("iPhone") !== -1) {
                    return 'web_iphone';
                } else if(navigator.userAgent.indexOf("Android") !== -1) {
                    return 'web_android';
                } else {
                    return 'web_pc';
                }
            }
            if(_getClientType() == "web_android") {
            	//安卓保存图片
                window.android.showErweima('c');
            } else if(_getClientType() == "web_iphone" || "ipad" || "iphone") {
            	parent.window.location.href = 'ioserweima://ios.cn';
            }
        })
       
    }
    function IsVideo(){
            var appID = G_Cookie.getAppID();
            G_AjaxApi.get('/api/app/getAppInfo?appID=' + appID, false, function(rsp){
                var rsp = JSON.parse(rsp);
                if (rsp.status === 200){
                    var hasVideo = rsp.data.hasVideo;
                    if(hasVideo == 0){
                        G_Prg.alert('视频课程正在筹备中，请期待~');
                    }else{
                        $('.click_vedioCourse').css('display','block');
                    }
                }

            });

        }

    init();
});